#include <common.h>

extern uint64_t*cpu_gpr;
static inline int check_reg_idx(int idx) {
  assert(idx >= 0 && idx < 33); //33 is pc
  return idx;
}

#define gpr(idx) (cpu_gpr[check_reg_idx(idx)])
#define get_pc() (cpu_gpr[check_reg_idx(32)])
static inline const char* reg_name(int idx, int width) {
  extern const char* regs[];
  return regs[check_reg_idx(idx)];
}

word_t reg_str2val(const char*s, bool *success);
void reg_display();
